import request from '@/utils/request'

// 查询乡村振兴内容列表
export function listAssociation(query) {
  return request({
    url: '/revita/association/list',
    method: 'get',
    params: query
  })
}

// 查询乡村振兴内容详细
export function getAssociation(id) {
  return request({
    url: '/revita/association/' + id,
    method: 'get'
  })
}

// 新增乡村振兴内容
export function addAssociation(data) {
  return request({
    url: '/revita/association',
    method: 'post',
    data: data
  })
}

// 修改乡村振兴内容
export function updateAssociation(data) {
  return request({
    url: '/revita/association',
    method: 'put',
    data: data
  })
}

// 删除乡村振兴内容
export function delAssociation(id) {
  return request({
    url: '/revita/association/' + id,
    method: 'delete'
  })
}

// 消息状态修改
export function changeNoticeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/revita/association/changeStatus',
    method: 'put',
    data: data
  })
}

// 获取乡村振兴内容阅读权限分类
export function getType() {
  return request({
    url: '/system/Assdict/list',
    method: 'get'
  })
}

// 获取乡村振兴内容镇区
export function getTowns(cityName) {
  const data={cityName}
  return request({
    url: '/revita/towns/townsList',
    method: 'post',
    data:data
  })
}
// 获取乡村振兴内容镇区
export function getTownList(id) {
  return request({
    url: '/revita/association/'+id,
    method: 'post',
  })
}



